package com.atguigu.tingshu.payment.service;

import com.wechat.pay.java.service.payments.model.Transaction;
import jakarta.servlet.http.HttpServletRequest;

import java.util.Map;

public interface WxPayService {

    /**
     * 微信支付
     * @param paymentType
     * @param orderNo
     * @param userId
     * @return
     */
    Map createJsapi(String paymentType, String orderNo, Long userId);

    /**
     * 根据orderNo 查询数据
     * @param orderNo
     * @return
     */
    Transaction queryPayStatus(String orderNo);

    /**
     * 微信回调
     * @param request
     */
    void wxnotify(HttpServletRequest request);

    /**
     * 创建微信支付二维码
     * @param paymentType
     * @param orderNo
     * @param userId
     * @return
     */
    Map<String, Object> createNative(String paymentType, String orderNo, Long userId);

    /**
     * 退款
     * @param orderNo
     * @return
     */
    Boolean refund(String orderNo);
}
